package com.springboot.shiro.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date: 2019/10/22 17:12
 * @author: ybzhu
 * @Description： 权限控制器
 */
@RestController
@RequestMapping("menu")
@ResponseBody
public class MenuController {

    /**
     * 权限管理
     * @return
     */
    @RequiresPermissions("sys:menu:list")
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public String list() {
        return "欢迎来到权限管理页面";
    }
    /**
     * 新增权限
     * @return
     */
    @RequiresPermissions("sys:menu:add")
    @RequestMapping(value = "/add",method = RequestMethod.GET)
    public String add() {
        return "创建权限成功";
    }

    /**
     * 编辑权限
     * @return
     */
    @RequiresPermissions("sys:menu:edit")
    @RequestMapping(value = "/edit",method = RequestMethod.GET)
    public String edit() {
        return "编辑权限成功";
    }

    /**
     * 删除权限
     * @return
     */
    @RequiresPermissions("sys:menu:delete")
    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    public String delete() {
        return "删除权限成功";
    }

}
